import { TGameObject, TGameObjectOptions } from './tGameObject';

import { drawImage, } from '../renderer';

interface ImageOptions extends TGameObjectOptions {
  img: CanvasImageSource;
}

export class Image extends TGameObject {
  img: CanvasImageSource;

  constructor (options: ImageOptions) {
    super(options);

    const { img, } = options;
    this.img = img;
  }

  render (canvasCtx: CanvasRenderingContext2D) {
    drawImage(canvasCtx, this);
  }
}
